'BASES.BAS Version 1.00. 1st March 1997. Ian Howlett. '---------------------------------------------------- 'This BAS file is used for converting numbers between one base and another. 'Bases 2-36 are handled, using digits 0-9 and then A-Z to give the 36 '"digits" needed. 'The functions do not handle numbers with a point (real numbers) or negative 'values (less than 0). 'There are two functions: 'DecimalToBase converts a decimal to a base. 'BaseToDecimal converts a number stored in another base to decimal (base 10). 'Usage Guide '------------ 'To convert 95 in base 10 (decimal) to base 8 (octal), use ' DecimalToBase(95,8) 'To convert 137 in base 8 (octal) to base 10 (decimal), use ' BaseToDecimal("137",8) ' (Remember the "" signs!) 'To convert a number in a non-decimal base to another non-decimal base, 'for example 42 in base 2 (binary) is 101010, but 2A in base 16 (hex). To 'convert it use: ' DecimalToBase(BaseToDecimal("101010",2),16) 'Bugs, errors and improvements '----------------------------- 'If you find a bug, get an error, need help using the functions or can 'suggest or have made any improvements, please contact me on one of the 'e-mail addresses listed below. I have tested both functions and they 'seem to work alright. 'If you get an error, first ensure that every parameter passed and the 'result of of the correct data type. e.g. Strings where strings should 'be passed, numbers where numbers should be passed, etc. 'The functions don't like numbers being passed using exponents, for example '3.215E+16 'The level of accuracy that Visual BASIC uses to store numbers sometimes 'gives slight errors. You should be alright up to at least '101,559,956,668,415 in base 10 ("ZZZZZZZZZ" in base 36)! 'Version Information '------------------- 'These functions were written using Visual BASIC 3 for Windows 3.11. 'However, there are no special version-specific commands, so any 'version of Visual BASIC should be alright. 'Legal Information '----------------- 'I give absolutely no guarantee whatsoever that these functions work and do 'anything I say they do. You use them completely at your own risk. 'This code is placed in the Public Domain. (PD). You may modify it, use 'it in your own programs, or use it however you see fit. A mention in 'some credits would be nice though! :) 'Contacting the Author '--------------------- 'These functions were written by: 'Ian Howlett. 'CompuServe: 101720,3025 'Internet: igh@compuserve.com 'FidoNet: 2:2500/708.20 (Last resort!) 'Web: http://ourworld.compuserve.com/homepages/igh